
#include "Main.h"

#define FRIDGE_DECLARE_GL_EXT_FNC(x,y) x y = 0

FRIDGE_DECLARE_GL_EXT_FNC( PFNGLGENRENDERBUFFERSPROC,			glGenRenderbuffers );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLBINDRENDERBUFFERPROC,			glBindRenderbuffer );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLRENDERBUFFERSTORAGEPROC,		glRenderbufferStorage );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLGENFRAMEBUFFERSPROC,			glGenFramebuffers );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLBINDFRAMEBUFFERPROC,			glBindFramebuffer );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLFRAMEBUFFERTEXTURE2DPROC,		glFramebufferTexture2D );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLFRAMEBUFFERRENDERBUFFERPROC,	glFramebufferRenderbuffer );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLDRAWBUFFERSPROC,				glDrawBuffers );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLDELETERENDERBUFFERSPROC,		glDeleteRenderbuffers );
FRIDGE_DECLARE_GL_EXT_FNC( PFNGLDELETEFRAMEBUFFERSPROC,			glDeleteFramebuffers );

#undef FRIDGE_DECLARE_GL_EXT_FNC

// Bind all the function pointers
void Platform_GLExt_BindFunctions()
{
	#define FRIDGE_BIND_EXT(x,y) y = (x) wglGetProcAddress(#y)

	FRIDGE_BIND_EXT( PFNGLGENRENDERBUFFERSPROC,			glGenRenderbuffers );
	FRIDGE_BIND_EXT( PFNGLGENRENDERBUFFERSPROC,			glGenRenderbuffers );
	FRIDGE_BIND_EXT( PFNGLBINDRENDERBUFFERPROC,			glBindRenderbuffer );
	FRIDGE_BIND_EXT( PFNGLRENDERBUFFERSTORAGEPROC,		glRenderbufferStorage );
	FRIDGE_BIND_EXT( PFNGLGENFRAMEBUFFERSPROC,			glGenFramebuffers );
	FRIDGE_BIND_EXT( PFNGLBINDFRAMEBUFFERPROC,			glBindFramebuffer );
	FRIDGE_BIND_EXT( PFNGLFRAMEBUFFERTEXTURE2DPROC,		glFramebufferTexture2D );
	FRIDGE_BIND_EXT( PFNGLFRAMEBUFFERRENDERBUFFERPROC,	glFramebufferRenderbuffer );
	FRIDGE_BIND_EXT( PFNGLDRAWBUFFERSPROC,				glDrawBuffers );
	FRIDGE_BIND_EXT( PFNGLDELETERENDERBUFFERSPROC,		glDeleteRenderbuffers );
	FRIDGE_BIND_EXT( PFNGLDELETEFRAMEBUFFERSPROC,		glDeleteFramebuffers );

	#undef FRIDGE_BIND_EXT
}

// eof
